package com.umiwe.permission.controller;

import com.umiwe.entity.UmiwePermission;
import com.umiwe.permission.service.PermissionService;
import com.umiwe.utils.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * 权限
 */
@RestController
@RequestMapping("/api/permission")
public class PermissionController {

    @Autowired
    private PermissionService permissionService;


    /**
     * 查询所有的权限信息
     * @return
     */
    @GetMapping("/list")
    public Result permissionList(){
        return permissionService.permissionList();
    }
    /**
     * 基于权限id修改权限信息
     * @param umiwePermission
     * @return
     */
    @GetMapping("/update")
    public Result permissionUpdate(UmiwePermission umiwePermission){
        return permissionService.permissionUpdate(umiwePermission);
    }
    /**
     * 基于权限id新增信息
     * @param umiwePermission
     * @return
     */
    @GetMapping("/insert")
    public Result permissionInsert(UmiwePermission umiwePermission){
        return permissionService.permissionInsert(umiwePermission);
    }
    /**
     * 基于权限id删除信息
     * @param umiwePermission
     * @return
     */
    @GetMapping("/delete")
    public Result permissionDelete(UmiwePermission umiwePermission){
        return permissionService.permissionDelete(umiwePermission);
    }
}
